import { t } from 'i18next'
import React, { FC } from 'react'
import { ItemActionWrap } from '../../../../../../components'
import { OperateIconComponent, operateType } from './component'
import { LiveModel } from '@/api/manager/live/interface'
const useOperate = (live: LiveModel['live']): operateType[] => {
	//是否游客
	if (live.isGuest) {
		return []
	} else {
		return ['offline']
	}
}
export const ItemAction: FC<LiveModel> = ({ mcc, status, live }) => {
	const icon = useOperate(live)
	return (
		<ItemActionWrap>
			{!status.isCalling ? (
				<div className="action-icons">{icon.map((x) => OperateIconComponent[x](mcc, { live }))}</div>
			) : (
				<div className="isCalling">{t('正在呼入视频会议...')}</div>
			)}
		</ItemActionWrap>
	)
}
